/**
 * 2018年12月4日上午10:24:24
 * @author 谢进财
 */
package com.baihang.project.ds.dao;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.baihang.framework.dao.BaseDao;
import com.baihang.framework.dao.Record;

@Repository
public class ReportDao extends BaseDao {
	public List<Record> getReportRecords(String sql){
		List<Map<String, Object>> result=super.getJdbcTemplate().queryForList(sql);
    	List<Record> recordList = new ArrayList<Record>();
    	for(Map<String, Object> map : result) {
    		Record record = new Record(map);
    		record.setStringColumn1((String)map.get("D_BanName"));//楼栋
    		record.setIntColumn1((int)map.get("D_Monitor"));//内控状态
    		record.setIntColumn2((int)map.get("D_state")); //销售状态
    		record.setBigDecimalColumn1((BigDecimal)map.get("D_Total"));//总价
    		//System.err.println((String)map.get("D_BanName"));
    		recordList.add(record);
    	}
    	return recordList;
	}
}
